package cn.iocoder.yudao.adminserver.modules.fi.controller.statistics;

import cn.iocoder.yudao.adminserver.modules.fi.controller.statistics.vo.StatisticsPageReqVO;
import cn.iocoder.yudao.adminserver.modules.fi.service.statistics.StatisticsService;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.Map;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

/**
 * 统计信息
 * @author : zhanggy
 * @date : 2021/9/18 21:14
 * @team : 西南综合开发支持部
 * @copyright : Sysware Technology Co., Ltd
 **/
@Api(tags = "统计信息")
@RestController
@RequestMapping("/statistics/")
@Validated
public class StatisticsController {

    @Resource
    private StatisticsService service;

    @GetMapping("/projectStatistics/page")
    @ApiOperation("获得项目统计分页")
    @PreAuthorize("@ss.hasPermission('fi:project:query')")
    public CommonResult<PageResult<Map>> getPage(@Valid StatisticsPageReqVO pageVO) {
        PageResult<Map> pageResult = this.service.selectPage(pageVO);
        return success(pageResult);
    }

}
